package com.woniu.util;

/**
 * @author 李桢
 * @time 2021/01/16 11:16:17
 */

public class ResultVO {
    private Integer code;
    private String message;
    private Object data;

    public ResultVO(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ResultVO success() {
        return new ResultVO(1, "操作成功");
    }
    public static ResultVO success(Object data) {
        return new ResultVO(1, "查询成功", data);
    }

    public static ResultVO failureForNull() { return new ResultVO(-1000, "参数为空"); }
    public static ResultVO failure() { return new ResultVO(0, "操作失败"); }


    public ResultVO(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResultVO() {
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }
}
